package org.spider.mapper;

import org.apache.ibatis.annotations.Select;
import org.spider.model.entity.SpiderAuthRoleEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lzy
 * @since 2022-06-17 09:39:16
 */
@Mapper
public interface SpiderAuthRoleMapper extends BaseMapper<SpiderAuthRoleEntity> {

    @Select("SELECT role_name FROM spider_auth_role WHERE id IN (SELECT role_id FROM spider_auth_user_role WHERE user_id = #{userId})")
    List<String> getRoleName(Long userId);
}
